﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;

namespace EntityModels.Normal
{
    /// <summary>
    /// 值比较器和属性快照
    /// </summary>
    public sealed class ImmutableClass
    {
        public int Value { get; set; }
        public ImmutableClass(int value)
        {
            Value = value;
        }

        private bool Equals(ImmutableClass other) => Value == other.Value;

        public override bool Equals(object? obj) => ReferenceEquals(this, obj) || obj is ImmutableClass other && Equals(other);

        public override int GetHashCode() => Value;
    }
}
